<html>
<head>
<meta NAME="description" CONTENT="R-group structures">
<meta NAME="author" CONTENT="Erika Biro">
<link REL ="stylesheet" TYPE="text/css" HREF="../../marvinmanuals.css" TITLE="Style">
<title>R-group structures</title>
</head>
<body>

<h1><a class="anchor" NAME="rgroup-structures">R-group structures</a></h1>

<h4><a class="anchor" name="rgroot">Root structure</a></h4>
An R-group structure describes a set of derivatives in one structure (substitution
variation). 
An R-group query structure consists of three components, a <em>root
structure</em> (often referred to as <em>scaffold</em>), a set of
<em>R-groups</em> and <em>R-group conditions</em>. The root structure contains
the portion of the query structure that does not vary among the structures
retrieved. R-groups (or R-groups) are attached as substituents to the root and
their sites are marked with R1, R2, R3, etc. symbols respectively. It is possible
to attach multiple R-groups to one root, even to a single atom of the structure.
One R-group can be attached multiple times to the same root, but it does not
mean that all these attachments should be filled by the same definition
(see occurrence conditions below for further information).
<p>
<table border="0" cellspacing="0" cellpadding="5" class="grid">
    <tr>
        <td align=center><img src="image066.png" width="108" height="120"></td>
        <td align=center><img src="image067.png" width="169" height="119"></td>
        <td align=center><img src="image068.png" width="189" height="99"></td>
    </tr>
</table>

<h4><a class="anchor" name="rgroups">R-group definitions</a></h4>
R-group definitions are variable lists of ligands connected to specific positions of the
root structure by their attachment points.
<p>
<table border="0" cellspacing="0" cellpadding="5" class="grid">
    <tr>
        <td align=center><img src="image069.png" width="154" height="105"></td>
        <td align=center><img src="image070.png" width="243" height="100"></td>
    </tr>
</table>
<p>
The core representation of R-group structures is the <code>RgMolecule</code> class.
The example below shows how to access the root and the R-group definitions  in
an R-group structure:
<pre>
	//get the root structure and enumerate the atoms, find R-Atoms.
        Molecule root = rgmol.getRoot();
        for (int i = root.getAtomCount() - 1; i >= 0; --i){
            MolAtom atom = root.getAtom(i);
            if (atom.getAtno() == MolAtom.RGROUP){
               ....
            }
        }
     
        //enumerate the R-group definitions and its fragments
        int nr = rgmol.getRgroupCount();
        for(int i = 0; i < nr; ++i) {
            int nrm = rgmol.getRgroupMemberCount(i);
            for(int j = 0; j < nrm; ++j) {
            	.... do something with rgmol.getRgroupMember(i, j)  
            }
        }
</pre>
</body>
</html>